package com.zy.web.demo.duoxiancheng.demo30;

import java.text.ParseException;


/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/9/2 11:27
 */
public class Test30 {

    public static void main(String[] args) throws InterruptedException, ParseException {
       Service30 service30 = new Service30();
       Runnable runnable = new Runnable() {
           @Override
           public void run() {
               service30.method();
           }
       };

       Thread[] threads = new Thread[10];
        for (int i = 0; i <threads.length ; i++) {
            threads[i] = new Thread(runnable);
        }
        for (int i = 0; i <threads.length ; i++) {
            threads[i].start();
        }
        Thread.sleep(2000);
        System.out.println("有效线程："+service30.lock.getQueueLength());
    }

}
